package com.servlet;

import com.dao.imp.AddUpdDelDaoImp;

import javax.servlet.*;
import javax.servlet.http.*;
import javax.servlet.annotation.*;
import java.io.IOException;

/**
 * @author Mathison
 * @Title: ${NAME}
 * @Package: ${PACKAGE_NAME}
 * @Description: TODO
 * @date 2021/11/26 13:44
 **/

@WebServlet(name = "DeleteAddressServlet", value = "/DeleteAddressServlet")
public class DeleteAddressServlet extends HttpServlet {
    @Override
    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        this.doPost(request, response);
    }

    @Override
    protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        int address_id = Integer.parseInt(request.getParameter("id"));
        String sql = "DELETE FROM address WHERE address_id="+address_id;
        AddUpdDelDaoImp addUpdDelDaoImp = new AddUpdDelDaoImp();
        addUpdDelDaoImp.addUpdDelGoods(sql);
    }
}
